package com.zjy.software.day8;

import java.time.LocalDate;
import java.util.Calendar;

public class CalendarDemo {
    public static void main(String[] args)
    {
        Calendar calendar =Calendar.getInstance();
        System.out.println("calendar = " + calendar);
        calendar.set(Calendar.YEAR,2021);
        calendar.set(Calendar.MONTH,1);
        calendar.set(Calendar.DAY_OF_MONTH,3);

        calendar.add(Calendar.DATE,3);

        int i = calendar.get(Calendar.DAY_OF_MONTH);
        System.out.println("i = " + i);

        //建议新项目使用新的Date函数,不适用上面的旧函数
        LocalDate localDate = LocalDate.now();
        localDate.plusDays(3);
    }
}
